package com.caiden_micheal.dynamic.process.mapper;

import com.caiden_micheal.dynamic.process.domain.DynamicProcess;
import com.caiden_micheal.dynamic.process.dto.DProcessQueryConditionDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DProcessMapper {
    void insertDProcess(DynamicProcess dynamicProcess);

    List<DynamicProcess> findPageQueryByCondition(DProcessQueryConditionDTO dProcessQueryConditionDTO);

    Integer findPageQueryByConditionCount(DProcessQueryConditionDTO dProcessQueryConditionDTO);

    @Select("SELECT * FROM sys_dynamic_process WHERE id=#{processId}")
    DynamicProcess findById(Long processId);

    @Select("SELECT * FROM sys_dynamic_process WHERE form_workflow_id=#{formWorkflowId}")
    List<DynamicProcess> findByFormWorkflowId(Long formWorkflowId);
}
